package meconsea.life.cms.entity;

import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;


@SuppressWarnings("serial")
@Entity
@Table(name="CMS_ARTICLE_Z")
@NamedQueries({
	@NamedQuery(name = ZArticle.LIST_ART_CLASS, query = " SELECT O.id,O.title,O.subtitle,O.keywords,O.summary,O.specialId,O.artClass,O.artClassName,O.artClassPath,O.indexImg,O.homeImg,O.artResource,O.author,O.commend,O.top,O.hot,O.comment,O.clicks,O.statusFlg,O.auditLevel,O.htmlPath,O.isHeader,O.createdAt,O.changedAt FROM ZArticle O WHERE O.artClass=:artClass ORDER BY O.changedAt"),
	@NamedQuery(name = ZArticle.LIST_ART_CLASS_PATH,query = "SELECT O.id,O.title,O.subtitle,O.keywords,O.summary,O.specialId,O.artClass,O.artClassName,O.artClassPath,O.indexImg,O.homeImg,O.artResource,O.author,O.commend,O.top,O.hot,O.comment,O.clicks,O.statusFlg,O.auditLevel,O.htmlPath,O.isHeader,O.createdAt,O.changedAt FROM ZArticle O WHERE O.artClassPath like :artClassPath ORDER BY O.changedAt"),
	@NamedQuery(name = ZArticle.LIST_ART_CLICKS,query = "SELECT O.id,O.title,O.subtitle,O.keywords,O.summary,O.specialId,O.artClass,O.artClassName,O.artClassPath,O.indexImg,O.homeImg,O.artResource,O.author,O.commend,O.top,O.hot,O.comment,O.clicks,O.statusFlg,O.auditLevel,O.htmlPath,O.isHeader,O.createdAt,O.changedAt FROM ZArticle O ORDER BY O.clicks,O.changedAt"),
	@NamedQuery(name = ZArticle.LIST_ART_COMMEND,query = "SELECT O.id,O.title,O.subtitle,O.keywords,O.summary,O.specialId,O.artClass,O.artClassName,O.artClassPath,O.indexImg,O.homeImg,O.artResource,O.author,O.commend,O.top,O.hot,O.comment,O.clicks,O.statusFlg,O.auditLevel,O.htmlPath,O.isHeader,O.createdAt,O.changedAt FROM ZArticle O WHERE O.commend = :commend  ORDER BY O.changedAt"),
	@NamedQuery(name = ZArticle.LIST_ART_HOT,query = "SELECT O.id,O.title,O.subtitle,O.keywords,O.summary,O.specialId,O.artClass,O.artClassName,O.artClassPath,O.indexImg,O.homeImg,O.artResource,O.author,O.commend,O.top,O.hot,O.comment,O.clicks,O.statusFlg,O.auditLevel,O.htmlPath,O.isHeader,O.createdAt,O.changedAt FROM ZArticle O WHERE O.hot = :hot ORDER BY O.changedAt"),
	@NamedQuery(name = ZArticle.LIST_ART_KEYWORDS,query = " SELECT O.id,O.title,O.subtitle,O.keywords,O.summary,O.specialId,O.artClass,O.artClassName,O.artClassPath,O.indexImg,O.homeImg,O.artResource,O.author,O.commend,O.top,O.hot,O.comment,O.clicks,O.statusFlg,O.auditLevel,O.htmlPath,O.isHeader,O.createdAt,O.changedAt FROM ZArticle O WHERE O.keywords like :keywords ORDER BY O.changedAt"),
	@NamedQuery(name = ZArticle.LIST_ART_NEW,query = "SELECT O.id,O.title,O.subtitle,O.keywords,O.summary,O.specialId,O.artClass,O.artClassName,O.artClassPath,O.indexImg,O.homeImg,O.artResource,O.author,O.commend,O.top,O.hot,O.comment,O.clicks,O.statusFlg,O.auditLevel,O.htmlPath,O.isHeader,O.createdAt,O.changedAt FROM ZArticle O ORDER BY O.changedAt"),
	@NamedQuery(name = ZArticle.LIST_ART_TITLE_LIKE,query = "SELECT O.id,O.title,O.subtitle,O.keywords,O.summary,O.specialId,O.artClass,O.artClassName,O.artClassPath,O.indexImg,O.homeImg,O.artResource,O.author,O.commend,O.top,O.hot,O.comment,O.clicks,O.statusFlg,O.auditLevel,O.htmlPath,O.isHeader,O.createdAt,O.changedAt FROM ZArticle O WHERE O.title like :title ORDER BY O.changedAt"),
	@NamedQuery(name = ZArticle.LIST_ART_CLASS_ALL,query = "SELECT O.id,O.title,O.subtitle,O.keywords,O.summary,O.specialId,O.artClass,O.artClassName,O.artClassPath,O.indexImg,O.homeImg,O.artResource,O.author,O.commend,O.top,O.hot,O.comment,O.clicks,O.statusFlg,O.auditLevel,O.htmlPath,O.isHeader,O.createdAt,O.changedAt FROM ZArticle O where O.artClass = :artClass order by O.changedAt"),
	@NamedQuery(name = ZArticle.COUNT_ART_CLASS,query = "SELECT COUNT(O.id) from ZArticle O where O.artClass=:artClass"),
	@NamedQuery(name = ZArticle.HEADER_ART_CLASS,query = "SELECT O.id,O.title,O.subtitle,O.keywords,O.summary,O.specialId,O.artClass,O.artClassName,O.artClassPath,O.indexImg,O.homeImg,O.artResource,O.author,O.commend,O.top,O.hot,O.comment,O.clicks,O.statusFlg,O.auditLevel,O.htmlPath,O.isHeader,O.createdAt,O.changedAt FROM ZArticle O WHERE O.isHeader=:isHeader ORDER BY O.changedAt")
})
public class ZArticle extends Article {
	public static final String HEADER_ART_CLASS = "Z_HEADER_ART";
	
	public static final String COUNT_ART_CLASS = "ZAL_COUNT_CLS";
	
	public static final String LIST_ART_CLASS_ALL = "ZAL_C_ALL";
	/**
	 * �Զ����where�����orderby���
	 */
	public static final String LIST_AUTO = "ZAL_auto";
	/**
	 * ������µķ����ȡ�����б�
	 */
	public static final String LIST_ART_CLASS = "ZAL_artClass";
	/**
	 * ������·����ȡ���и÷��ࣨ��(֮�ࣩ�������б�
	 */
	public static final String LIST_ART_CLASS_PATH = "ZAL_artClass_path";
	/**
	 * ������±���Ĺؼ��ģ���ѯ����
	 */
	public static final String LIST_ART_TITLE_LIKE = "ZAL_title_like";
	
	/**
	 * ������µĹؼ��ģ���ѯ����
	 */
	public static final String LIST_ART_KEYWORDS = "ZAL_keywords";
	
	/**
	 * ��ȡ���µ�����
	 */
	public static final String LIST_ART_NEW = "ZAL_art_new";
	
	/**
	 * ��ȡ�Ƽ�����
	 */
	public static final String LIST_ART_COMMEND = "ZAL_art_commend";
	
	/**
	 * ��ȡ�ȵ�����
	 */
	public static final String LIST_ART_HOT = "ZAL_art_hot";
	
	public static final String LIST_ART_CLICKS ="ZAL_art_clicks";
	@Override
	public String toString(){
		return "����(ס):"+getId()+"";
	}
}
